import request from '@/utils/request'

// 获取主屏数据
export function homeData(data) {
  return request({
    url: 'api/CksLargeTotal/GetTotalData',
    method: 'post',
    data: data
  })
}

// 停机时间和故障原因统计数据
export function equipmentfailureHistory(data) {
  const lang = window.sessionStorage.getItem('lang') || 'zh'
  return request({
    url:
      'api/Equipmentfailure/GetEquipmentfailureHistory?Language=' +
      (lang == 'zh' ? 'cn' : lang),
    method: 'get'
  })
}

//获取OEE数据
export function getOeeData(){
  return request({
    url:'api/ThicknessDetection/QueryPR',
    method:'post'
  })
}

// 退出方法
export function logout() {
  return request({
    url: '/logout',
    method: 'post'
  })
}

// 获取验证码
export function getCodeImg(params) {
  return request({
    url: '/captchaImage',
    method: 'get',
    params
  })
}

// 分屏1数据
export function DetectionHistory(data) {
  return request({
    url: 'api/CksLargeTotal/DetectionHistory',
    method: 'post',
    data
  })
}

// 分屏1数据导出
export function ExportQueryList(data) {
  return request({
    url: 'api/CksLargeTotal/ExportQueryList',
    method: 'post',
    responseType: 'blob',
    data
  })
}

// 分屏2数据
export function HistoryDataTrends(data) {
  return request({
    url: 'api/CksLargeTotal/HistoryDataTrends',
    method: 'post',
    data
  })
}

// 分屏3数据
export function DetectionHistoryNew(data) {
  return request({
    url: 'api/CksLargeTotal/DetectionHistoryNew',
    method: 'post',
    data
  })
}

// 分屏3数据导出
export function ExportQueryListNew(data) {
  return request({
    url: 'api/CksLargeTotal/ExportQueryListNew',
    method: 'post',
    responseType: 'blob',
    data
  })
}

// 分屏3数据详情导出
export function ExportQuerydetails(data) {
  return request({
    url: 'api/CksLargeTotal/ExportQuerydetails',
    method: 'post',
    responseType: 'blob',
    data
  })
}

// 分屏3数据
export function GetThicknessList(data) {
  return request({
    url: 'api/CksLargeTotal/GetThicknessList',
    method: 'post',
    data
  })
}
